package com.tanhua.server.job;


import com.tanhua.dubbo.api.mongo.VoiceRemainTimeApi;
import org.apache.dubbo.config.annotation.Reference;
import org.joda.time.DateTime;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class UpdateTimeJob {

    @Reference
    private VoiceRemainTimeApi remainTimeApi;


    @Scheduled(cron = "0 0 0 * * ?") // 每天凌晨修改剩余次数为9
    public void updateTime() {
        remainTimeApi.updateStatus(9);
        System.out.println(new DateTime().toString("yyyy-MM-dd HH:mm:ss") + " 定时刷新桃花传音次数任务已经执行完成");

    }

}
